<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@page import="java.util.Date"%>
<%@page import="java.util.Calendar"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>

<link rel="stylesheet" type="text/css"
	href="<c:url value="/css/themes/default/easyui.css"/>">
<link rel="stylesheet" type="text/css"
	href="<c:url value="/css/themes/icon.css"/>">
<link rel="stylesheet" type="text/css"
	href="<c:url value="/css/style.css"/>">

<script type="text/javascript" src="<c:url value="/js/jquery.min.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/js/jquery.easyui.min.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/js/easyui-lang-zh_CN.js"/>"></script>
<script type="text/javascript" src="<c:url value="/js/script.js"/>"></script>
<script type="text/javascript" src="<c:url value="/js/zzsc.js"/>"></script>
</head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<script>
$(function(){
 
	//批量删除挂号信息
	$("#cy_xzdzbl-Choose").linkbutton({
		onClick : function() {
			$.messager.confirm("提示", "确定要删除吗？", function(v) {
				if (v) {
					//获取所有选中的编号
					var rows = $("#cy_gh_xzdzbl").datagrid("getSelections");
					//将编号保存到数组中
					var arr = [];
					for (var i = 0; i < rows.length; i++) {
						arr.push(rows[i].dzcfNo);
					}
					//用form提交
					$('<form>').form('submit', {
						url : 'cydeleteElectronicPrescription',
						onSubmit : function(param) {
							param.list = arr;
						},
						success : function(data) {
							var json = eval("(" + data + ")");
							$.messager.alert("提示", json.reason);
							$("#cy_gh_xzdzbl").datagrid("reload");
						}
					});
				}
			});
		}
	});
	

		//改变行内样式
		$('#cy_gh_xzdzbl').datagrid({
			rowStyler : function(index, row) {
				var endtime = new Date();
				var year = endtime.getYear() + 1900;
				var mouth = endtime.getMonth() + 1;
				if (mouth < 10) {
					mouth = "0" + mouth;
				}
				var day = endtime.getDate();
				if (day < 10) {
					day = "0" + day;
				}
				var data = year + "-" + mouth + "-" + day;
				if (row.ghDate == data) {
					return 'color:red;';
				}
			}
		});	
	
    })
</script>

	<!-- 电子病历的选择电子病历 -->
	<div class="easyui-layout" data-options="fit:true">
			<div data-options="region:'north',height:'45px',split:true,panelHeight:'auto'"
				style="width: 100px; padding: 5px; padding-left: 380px;">
	
				<input id="" class="easyui-searchbox"
					data-options="border: false, menu: '#mm', width: 220, prompt: '请输入你要查询的内容'" />
					
					<a id="cy_xzdzbl-Choose" class="easyui-linkbutton"
					data-options="iconCls:'icon-add',width: '80px'">删除</a>
					<a id="cyxzbtn-qx" class="easyui-linkbutton"
					data-options="iconCls:'icon-add',width: '80px'">取消</a>
			</div>
	
			<div data-options="region:'center'" style="">
					<table id="cy_gh_xzdzbl" class="easyui-datagrid"
							data-options="
										url:'queryhisElectronicPrescription',
										fitColumns:true,
										fit:true,
										pagination: true,
										width:'100%',
										pageSize: 5,
										pageList: [5, 10, 15, 20],
										rownumbers: true,					
									    border: false
										">
									<thead>
										<tr>				
											<th data-options="field:'dzcfNo',width:'10%'">处方号</th>
											<th data-options="field:'ksName',width:'10%'">状态</th>
											<th data-options="field:'dzcfType',width:'10%'">处方类型</th>	
											<th data-options="field:'dzcfDate',width:'10%'">处方日期</th>	
											<th data-options="field:'ghNo',width:'10%'">门诊号</th>	
											<th data-options="field:'zfNo',width:'10%'">住院号</th>	
											<th data-options="field:'ksName',width:'10%'">科室</th>
											<th data-options="field:'dzfcDoctor',width:'10%'">处方医生</th>
											<th data-options="field:'brName',width:'10%'">病人姓名</th>
											<th data-options="field:'brSex',width:'10%'">病人性别</th>
											<th data-options="field:'brAge',width:'10%'">病人年龄</th>		
											<th data-options="field:'mzyzType',width:'10%'">医嘱类型</th>	
											<th data-options="field:'mzyzState',width:'10%'">医嘱状态</th>					
										</tr>
							</thead>
					</table>		
				</div>		
			<div id="mm" style="width: 120px">
					<div data-options="name:'name'"></div>
			</div>
</body>
</html>